#[doc = "Register `SPIMIS` reader"]
pub struct R(crate::R<SPIMIS_SPEC>);
impl core::ops::Deref for R {
    type Target = crate::R<SPIMIS_SPEC>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl core::convert::From<crate::R<SPIMIS_SPEC>> for R {
    fn from(reader: crate::R<SPIMIS_SPEC>) -> Self {
        R(reader)
    }
}
#[doc = "Masked TX FIFO interrupt status.\n\nValue on reset: 1"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum TXMIS_A {
    #[doc = "0: No interrupt is generated."]
    NO_INTERRUPT = 0,
    #[doc = "1: The interrupt is generated."]
    HAS_INTERRUPT = 1,
}
impl From<TXMIS_A> for bool {
    #[inline(always)]
    fn from(variant: TXMIS_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `txmis` reader - Masked TX FIFO interrupt status."]
pub struct TXMIS_R(crate::FieldReader<bool, TXMIS_A>);
impl TXMIS_R {
    pub(crate) fn new(bits: bool) -> Self {
        TXMIS_R(crate::FieldReader::new(bits))
    }
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> TXMIS_A {
        match self.bits {
            false => TXMIS_A::NO_INTERRUPT,
            true => TXMIS_A::HAS_INTERRUPT,
        }
    }
    #[doc = "Checks if the value of the field is `NO_INTERRUPT`"]
    #[inline(always)]
    pub fn is_no_interrupt(&self) -> bool {
        **self == TXMIS_A::NO_INTERRUPT
    }
    #[doc = "Checks if the value of the field is `HAS_INTERRUPT`"]
    #[inline(always)]
    pub fn is_has_interrupt(&self) -> bool {
        **self == TXMIS_A::HAS_INTERRUPT
    }
}
impl core::ops::Deref for TXMIS_R {
    type Target = crate::FieldReader<bool, TXMIS_A>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Masked RX FIFO interrupt status.\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum RXMIS_A {
    #[doc = "0: No interrupt is generated."]
    NO_INTERRUPT = 0,
    #[doc = "1: The interrupt is generated."]
    HAS_INTERRUPT = 1,
}
impl From<RXMIS_A> for bool {
    #[inline(always)]
    fn from(variant: RXMIS_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `rxmis` reader - Masked RX FIFO interrupt status."]
pub struct RXMIS_R(crate::FieldReader<bool, RXMIS_A>);
impl RXMIS_R {
    pub(crate) fn new(bits: bool) -> Self {
        RXMIS_R(crate::FieldReader::new(bits))
    }
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> RXMIS_A {
        match self.bits {
            false => RXMIS_A::NO_INTERRUPT,
            true => RXMIS_A::HAS_INTERRUPT,
        }
    }
    #[doc = "Checks if the value of the field is `NO_INTERRUPT`"]
    #[inline(always)]
    pub fn is_no_interrupt(&self) -> bool {
        **self == RXMIS_A::NO_INTERRUPT
    }
    #[doc = "Checks if the value of the field is `HAS_INTERRUPT`"]
    #[inline(always)]
    pub fn is_has_interrupt(&self) -> bool {
        **self == RXMIS_A::HAS_INTERRUPT
    }
}
impl core::ops::Deref for RXMIS_R {
    type Target = crate::FieldReader<bool, RXMIS_A>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Masked RX timeout interrupt state.\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum RTMIS_A {
    #[doc = "0: No interrupt is generated.."]
    NO_INTERRUPT = 0,
    #[doc = "1: The interrupt is generated."]
    HAS_INTERRUPT = 1,
}
impl From<RTMIS_A> for bool {
    #[inline(always)]
    fn from(variant: RTMIS_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `rtmis` reader - Masked RX timeout interrupt state."]
pub struct RTMIS_R(crate::FieldReader<bool, RTMIS_A>);
impl RTMIS_R {
    pub(crate) fn new(bits: bool) -> Self {
        RTMIS_R(crate::FieldReader::new(bits))
    }
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> RTMIS_A {
        match self.bits {
            false => RTMIS_A::NO_INTERRUPT,
            true => RTMIS_A::HAS_INTERRUPT,
        }
    }
    #[doc = "Checks if the value of the field is `NO_INTERRUPT`"]
    #[inline(always)]
    pub fn is_no_interrupt(&self) -> bool {
        **self == RTMIS_A::NO_INTERRUPT
    }
    #[doc = "Checks if the value of the field is `HAS_INTERRUPT`"]
    #[inline(always)]
    pub fn is_has_interrupt(&self) -> bool {
        **self == RTMIS_A::HAS_INTERRUPT
    }
}
impl core::ops::Deref for RTMIS_R {
    type Target = crate::FieldReader<bool, RTMIS_A>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Masked RX overflow interrupt state.\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum RORMIS_A {
    #[doc = "0: No interrupt is generated.."]
    NO_INTERRUPT = 0,
    #[doc = "1: The interrupt is generated."]
    HAS_INTERRUPT = 1,
}
impl From<RORMIS_A> for bool {
    #[inline(always)]
    fn from(variant: RORMIS_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `rormis` reader - Masked RX overflow interrupt state."]
pub struct RORMIS_R(crate::FieldReader<bool, RORMIS_A>);
impl RORMIS_R {
    pub(crate) fn new(bits: bool) -> Self {
        RORMIS_R(crate::FieldReader::new(bits))
    }
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> RORMIS_A {
        match self.bits {
            false => RORMIS_A::NO_INTERRUPT,
            true => RORMIS_A::HAS_INTERRUPT,
        }
    }
    #[doc = "Checks if the value of the field is `NO_INTERRUPT`"]
    #[inline(always)]
    pub fn is_no_interrupt(&self) -> bool {
        **self == RORMIS_A::NO_INTERRUPT
    }
    #[doc = "Checks if the value of the field is `HAS_INTERRUPT`"]
    #[inline(always)]
    pub fn is_has_interrupt(&self) -> bool {
        **self == RORMIS_A::HAS_INTERRUPT
    }
}
impl core::ops::Deref for RORMIS_R {
    type Target = crate::FieldReader<bool, RORMIS_A>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl R {
    #[doc = "Bit 3 - Masked TX FIFO interrupt status."]
    #[inline(always)]
    pub fn txmis(&self) -> TXMIS_R {
        TXMIS_R::new(((self.bits >> 3) & 0x01) != 0)
    }
    #[doc = "Bit 2 - Masked RX FIFO interrupt status."]
    #[inline(always)]
    pub fn rxmis(&self) -> RXMIS_R {
        RXMIS_R::new(((self.bits >> 2) & 0x01) != 0)
    }
    #[doc = "Bit 1 - Masked RX timeout interrupt state."]
    #[inline(always)]
    pub fn rtmis(&self) -> RTMIS_R {
        RTMIS_R::new(((self.bits >> 1) & 0x01) != 0)
    }
    #[doc = "Bit 2 - Masked RX overflow interrupt state."]
    #[inline(always)]
    pub fn rormis(&self) -> RORMIS_R {
        RORMIS_R::new(((self.bits >> 2) & 0x01) != 0)
    }
}
#[doc = "SPIMIS is the SPI masked interrupt status register.\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [spimis](index.html) module"]
pub struct SPIMIS_SPEC;
impl crate::RegisterSpec for SPIMIS_SPEC {
    type Ux = u16;
}
#[doc = "`read()` method returns [spimis::R](R) reader structure"]
impl crate::Readable for SPIMIS_SPEC {
    type Reader = R;
}
#[doc = "`reset()` method sets SPIMIS to value 0x08"]
impl crate::Resettable for SPIMIS_SPEC {
    #[inline(always)]
    fn reset_value() -> Self::Ux {
        0x08
    }
}
